﻿<UserControl x:Class="AgFractal.Controls.ImagePresenter"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    >
    <UserControl.Resources>
        <Storyboard x:Name="Storyboard1">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="img" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame x:Name="zoomX" KeyTime="00:00:01" Value="2"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="img" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                <SplineDoubleKeyFrame x:Name="zoomY" KeyTime="00:00:01" Value="2"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>
    <Canvas x:Name="cnv">
        <Image x:Name="img" MouseLeftButtonDown="Image_MouseLeftButtonDown" 
               MouseMove="Image_MouseMove" 
               MouseLeftButtonUp="Image_MouseLeftButtonUp">
            <Image.RenderTransform>
                <TransformGroup>
                    <ScaleTransform x:Name="imgScale"/>
                    <SkewTransform/>
                    <RotateTransform/>
                    <TranslateTransform/>
                </TransformGroup>
            </Image.RenderTransform>
        </Image>
    </Canvas>
</UserControl>